home *** CD-ROM | disk | FTP | other *** search
/ Fritz: All Fritz / All Fritz.zip / All Fritz / FILES / PROGNG_C / CUTILV1.LZH / SWITCH.C86 < prev    next >
Text File  |  1983-12-18  |  988b  |  34 lines

  1. /* switch.c          switch display monitors
  2.               by Earl C. Terwilliger Jr.
  3.               05-04-1983
  4. */
  5. main()
  6. {
  7.   struct regval { int ax,bx,cx,dx,si,di,ds,es; };
  8.   struct regval srv,rrv;
  9.  
  10.   srv.cx = 0X0F00;                   /* remove the cursor */
  11.   srv.ax = 0X0100;                   /* set cursor type   */
  12.   sysint(16,&srv,&rrv);
  13.  
  14.   srv.ax = 0X0600;                   /* scroll & blank    */
  15.   srv.cx = 0X0000;                   /* top left        */
  16.   srv.dx = 0X184F;                   /* bottom right        */
  17.   srv.bx = 0X0700;                   /* fill attribute    */
  18.   sysint(16,&srv,&rrv);
  19.  
  20.   sysint(17,&srv,&rrv);                /* equipment flag    */
  21.   rrv.bx = rrv.ax;                   /* copy it        */
  22.   rrv.bx &= 0X0030;                   /* Mask for video    */
  23.   rrv.ax ^= rrv.bx;
  24.   if (rrv.bx == 0X0030) {
  25.    rrv.ax |= 0X0020;
  26.    srv.ax = 0X0002;
  27.   }
  28.   else { rrv.ax |= 0X0030;
  29.      srv.ax = 0X0007;
  30.   }
  31.   pokeb(0X0410,0,rrv.ax);               /* save new equip    */
  32.   sysint(16,&srv,&rrv);                /* Screen back on    */
  33. }
  34.